<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function person(name,age) {
            this.name=name
            this.age=age
            return 1
        }
         function myNew(fn,...args) {
            const obj={}
            const re=fn.call(obj,...args)
            obj.__proto__=fn.prototype
            return typeof re==='object'&&re!==null||typeof re==='function'?re:obj
         }
        const ming=myNew(person,'明',18)
        console.log(ming);
    </script>
</body>
</html>